import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isLogin: false,
    adminName: '',
    orderSearch: '',
  },
  getters: {
    isLogin: state => state.isLogin,
  },
  mutations: {
    adminLogin(state, username) {
      state.adminName = username;
    },
    userStatus(state, flag) {
      state.isLogin = flag
    },
    searchOrder(state, input3) {
      state.orderSearch = input3;
    }
  },
  actions: {
    //获取登录状态
    userLogin({ commit }, flag) {
      commit("userStatus", flag)
    },
  },
  modules: {
  }
})
